/**
 * Created by Administrator on 2018/12/06/0006.
 */


//密码验证
function checkPassword(str){
    var reg1 = /[!@#$%^&*()_?<>{}]{1}/;
    var reg2 = /([a-zA-Z0-9!@#$%^&*()_?<>{}]){8,18}/;
    var reg3 = /[a-zA-Z]+/;
    var reg4 = /[0-9]+/;
    if(reg1.test(str) && reg2.test(str) && reg3.test(str) && reg4.test(str)){
        return true;
    }else if(!reg1.test(str)){
        layer.msg("需包含一个特殊字符",{icon:5,time:2000});
        return false;
    }else if(!reg2.test(str)){
        layer.msg("长度在8-18位",{icon:5,time:2000});
        return false;
    }else if(!reg3.test(str)){
        layer.msg("需含有字母",{icon:5,time:2000});
        return false;
    }else if(!reg4.test(str)){
        layer.msg("需含有数字",{icon:5,time:2000});
        return false;
    }
}